<template>
  <div class="content_card">
    <UHeader>
      <template slot="left">
        <el-input
          v-model="searchParams.orderId"
          size="small"
          clearable
          style="width: 200px"
          placeholder="请输入订单编号"
          @clear="searchParams = Object.assign({}, searchParams, searchParams)">
          <i slot="prefix" class="el-input__icon el-icon-search"/>
        </el-input>
        <el-button size="mini" type="success" style="margin-right: 15px;margin-left: 15px" @click="searchParams = Object.assign({}, searchParams, searchParams)" >查询</el-button>
        <StatusTab :datas="statusData" :select.sync="searchParams.status" @onChange="searchParams = Object.assign({}, searchParams, searchParams)" />
      </template>
    </UHeader>
    <UTable ref="mTable" :search-api="search" :config="config" :columns="columns" :hidel-operate="true" :search-params="searchParams" />

  </div>

</template>
<script>
import UHeader from '@/components/UHeader'
import UTable from '@/components/UTable'
import { baseTableConfig } from '@/utils/baseConfig'
import StatusTab from '@/components/StatusTab'
import { search } from '@/api/order'
import columns from './columns'
export default {
  components: {
    UTable, StatusTab, UHeader
  },
  data() {
    return {
      search: search,
      searchParams: { status: '', orderId: '' },
      config: baseTableConfig,
      statusData: [{ value: '', label: '全部' }, { value: 0, label: '待支付' }, { value: 1, label: '待派遣' }, { value: 2, label: '待取货 ' }, { value: 3, label: '配送中' }, { value: 4, label: '已完成' }],
      columns: columns
    }
  },
  methods: {

  }
}
</script>

<style scoped>

</style>
